//
//  Location.h
//  sztdcs
//
//  Created by mokai on 14/12/27.
//  Copyright (c) 2014年 mokai. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
@class Location;
@protocol LocationDelegate<NSObject>
@required
-(void)location:(Location *)location longitude:(CGFloat)longitude latitude:(CGFloat)latitude;
@optional
/**
 *  地址定位，如果有重写则回调经纬度方法后自动获取地址
 *
 *  @param location
 *  @param address
 */
-(void)location:(Location *)location address:(CLPlacemark *)address;

/**
 定位失败
 **/
-(void)locationFail:(Location *)location;

@end

@interface Location : NSObject<CLLocationManagerDelegate,UIAlertViewDelegate>
@property(nonatomic,weak) id<LocationDelegate> delegate;

/**
 *  开始定位
 *
 *  @param isRepeat 是否实时重复
 */
-(void)start:(BOOL)isRepeat;

/**
 *  停止定位
 */
-(void)stop;

@end